const mongoose = require("mongoose");

const userCartSchema = new mongoose.Schema({
    shopsId:{
        type: mongoose.Schema.Types.ObjectId,    // 商店id
        ref: 'shopsModel'
    },
    userId: {
        type: mongoose.Schema.Types.ObjectId,  
        ref: 'usersModel'
    } , // 购物车所属⽤用户 id
    goodId:{
        type: mongoose.Schema.Types.ObjectId,    // 所属订单的商品 id
        ref: 'goodsModel'
    },
    count:Number,
    isjiesuan:{type:Boolean,default:false},
})

mongoose.model("userCartModel", userCartSchema, "userCart");